'use strict';

const Controller = require('egg').Controller;
const api = require('../../config/api');

class ResearchController extends Controller {
  async index() {
    const { ctx } = this;
    const res = await ctx.curl(`${api.basicUrl}/Research/getResearchList`, {
      // 必须指定 method
      method: 'GET',
      contentType: 'json',
      dataType: 'json',
      data: {
        page: 1,
        pagesize: 10,
      },
    });
    console.log('ResearchController, res:', res.data);
    await ctx.render('research.html', { pageData: res.data });
  }
}

module.exports = ResearchController;
